package com.vietsanto.common.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by VietNV2 on 12/16/2014.
 */
public class WelcomeController extends AbstractController{


    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse httpServletResponse) throws Exception {

        ModelAndView model = new ModelAndView("welcome");
        model.addObject("msg","hello world");
        return model;
    }

    @RequestMapping(value = "/test",method = RequestMethod.GET)
    public ModelAndView test(){
        ModelAndView model = new ModelAndView("welcome");
        model.addObject("msg","test mapping welcome");
        return model;
    }
}
